package com.zy.explore.idempotent.interfaces.facade.v1;

import com.alibaba.fastjson.JSON;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.zy.explore.idempotent.infrastructure.annotation.Idempotent;
import com.zy.explore.idempotent.interfaces.frm.ExampleFrm;
import com.zy.explore.idempotent.interfaces.vo.ExampleVO;
import com.zy.explore.idempotent.interfaces.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description 测试幂等Facade
 *
 * @author 🇨🇳中国印🇨🇳
 * @date 2021年07月06日 21:58
 */
@Api(tags = "幂等测试Facade")
@RestController
@RequestMapping("/idempotent")
public class TestIdempotentFacade {

    /**
     * 新增数据
     *
     * @param frm 待新增的Frm对象
     * @return 成功返回新增后的VO对象，失败返回null
     */
    @Idempotent
    @ApiOperationSupport(order = 10)
    @ApiOperation("新增数据")
    @PostMapping("/insert")
    public ResultVO<String> insert(@RequestBody ExampleFrm frm) {
        return ResultVO.getSuccess("幂等测试");
    }

}
